<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取当前 magic_quotes_runtime 配置选项的激活状态</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.get-magic-quotes-gpc.html">« get_magic_quotes_gpc</a></li>
      <li style="float: right;"><a href="function.get-required-files.html">get_required_files »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.info.html">PHP 选项/信息 函数</a></li>
    <li>获取当前 magic_quotes_runtime 配置选项的激活状态</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.get-magic-quotes-runtime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">get_magic_quotes_runtime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">get_magic_quotes_runtime</span> &mdash; <span class="dc-title">获取当前 magic_quotes_runtime 配置选项的激活状态</span></p>

 </div>
 
 <div id="function.get-magic-quotes-runtime-refsynopsisdiv">
   <div class="warning"><strong class="warning">警告</strong><p class="simpara">本函数已自 PHP 7.4.0
起<em class="emphasis">弃用</em>，自 PHP 8.0.0 起<em class="emphasis">移除</em>。强烈建议不要依赖本函数。</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-function.get-magic-quotes-runtime-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>get_magic_quotes_runtime</strong></span>(): <span class="type">bool</span></div>

  <p class="simpara">
   返回当前 <a href="info.configuration.html#ini.magic-quotes-runtime" class="link">magic_quotes_runtime</a> 配置选项的激活状态。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.get-magic-quotes-runtime-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.get-magic-quotes-runtime-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   magic_quotes_runtime 在关闭时返回 0，否则返回 1。
   自 PHP 5.4.0 起始终返回 <strong><code>false</code></strong>。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.get-magic-quotes-runtime-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>7.4.0</td>
       <td>
        弃用此函数。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.get-magic-quotes-runtime-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-563">
    <p><strong>示例 #1 <span class="function"><strong>get_magic_quotes_runtime()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;检测&nbsp;magic_quotes_runtime&nbsp;是否已经激活<br /></span><span style="color: #007700">if(</span><span style="color: #0000BB">get_magic_quotes_runtime</span><span style="color: #007700">())<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;关闭功能<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">set_magic_quotes_runtime</span><span style="color: #007700">(</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.get-magic-quotes-runtime-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.get-magic-quotes-gpc.html" class="function" rel="rdfs-seeAlso">get_magic_quotes_gpc()</a> - 获取当前 magic_quotes_gpc 的配置选项设置</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>